<%@ page contentType="text/html;charset=UTF-8"%>
 <%@page import="com.augurit.common.system.web.auth.form.LoginUserForm"%>
 <%LoginUserForm form=(LoginUserForm)request.getSession().getAttribute("SES_LOGIN_USER"); %>
<%@ include file="/common/taglibs.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- dwr libs -->
<script type='text/javascript' src="${ctx}/dwr/engine.js"></script>
<script type='text/javascript' src="${ctx}/dwr/util.js"></script>
<script type='text/javascript' src="${ctx}/dwr/interface/FileUploadCntl.js"></script>
<script src="${ctx}/gzcgwsp/resources/js/YwUtil.js" type="text/javascript"></script>
<link href="${ctx}/gzcgwsp/resources/css/common-ui.css" rel="stylesheet" type="text/css" />
<script src="${ctx}/gzcgwsp/resources/js/YwEnterprise.js" type="text/javascript"></script>
<script src="${ctx}/gzcgwsp/rqqyjyxk/YwRqQyjyxk/js/finalDataView.js" type="text/javascript"></script>
<script src="${ctx}/gzcgwsp/rqqyjyxk/YwRqQyjyxk/js/gdOtherInfoDataView.js" type="text/javascript"></script>
<script src="${ctx}/resources/js/jquery/jquery.js" type="text/javascript"></script>
<%@ include file="/wf/public/meta_wf.jsp"%>
<%@ include file="/common/meta.jsp"%>

<script type="text/javascript">
var saveAndSendFlag = undefined;
var _win;
var _editwin;

var WF_CONFIG = {
	templateCode: '${template.templateCode}',
	version: '${instance.version}',
	viewName: 'dzb',
	activityName: '${instance.activityName}',
	masterEntity: '${template.masterEntity}',
	masterEntityKey: '',
	procInstId: '${instance.procInstId}',
	processDefId:'${instance.processDefId}',
	taskInstDbid: '',
	wfBusInstanceId: ''
};


Ext.onReady(function(){

Ext.QuickTips.init();
    Ext.getBody().mask("页面加载中，请稍候......");
    var id_ = document.forms[0].id.value;
    var acceptNo_ = document.forms[0].acceptNo.value;
    if (id_ == '') {
      if (Ext.getCmp('WF_PRINT')) Ext.getCmp('WF_PRINT').setDisabled(true);
    }
    var centerTabPanel = Ext.getCmp('centerPanel');
    var ywPanel = new Ext.TabPanel({
        id: 'YwRqJyxkgdpanel',
        renderTo: 'tpanel',
        border: false,
        height: 750,
        enableTabScroll: true,
        defaults: {autoScroll: true},
        items: [
        ],
        listeners: {
            remove: function(tp, c) {
                c.hide();
            },
            afterlayout: function(c) {
                c.strip.setWidth(c.stripWrap.getWidth() - 2);
            },
            tabchange : function (tpanel, p) {        
            }
        }
    });
       // var title = ywPanel.getActiveTab().title;
       // alert(title);
      
      
       var jbxxPanel = new Ext.Panel({title: '基本信息', tabCls: 'right-tab', contentEl: 'tpanel01', border: false});
        ywPanel.add(jbxxPanel);
        var cpbPanel=new Ext.Panel({title: '行政许可审查表', tabCls: 'right-tab', contentEl: 'tpanel02', border: false});
          var gsPanel=new Ext.Panel({title: '公示', tabCls: 'right-tab', contentEl: 'tpanel03', border: false});
      	 
        ywPanel.add(cpbPanel);
        ywPanel.add(gsPanel);
        ywPanel.setActiveTab(jbxxPanel);
        ywPanel.doLayout(true);
        Ext.TaskMgr.start.defer(1500, this, [{run:function(){Ext.getBody().unmask();}, interval:1, repeat:1}]);
});

function save(){
	var params = $("#Simpleform").serialize();
	var url="${ctx}/dllszy!saveSimpleData.action";
	if(!validateForm()) return;
	$.ajax({
		url : url,
		type : "post",
		dataType : "html",
		data : params,
		success : function(msg) {
			if(msg!=null){
				alert('保存成功!');
				var ids=msg.split(",");
				window.location.href="${ctx}/dllszy!simpleInput.action?templateCode=csdlwjqx&id="+ids[0]+"&taskInstDbid="+ids[1];
				
				parent.opener.document.location.href="${ctx}/dllszy!listsimpleData.action";	
					
			}else{
				alert('保存失败！');
			}
			
		},
		error:function() {
			alert("添加失败！请刷新重试！");
		}
	});
}

function doGs(){
	var action="${ctx}/dllszy!doSimpleGs.action?id="+document.getElementById("id").value+"&templateCode="+document.getElementById("templateCode").value;
	var lszyArea=document.getElementById("lszyArea").value;
	if(lszyArea==""){
		alert("占用面积为空");
		return;
	}
	var zysjqssj=document.getElementById("zysjqssj").value;
	var zysjjssj=document.getElementById("zysjjssj").value;
	if(zysjqssj==""){
		alert("占用开始时间为空");
		return;
	}
	if(zysjjssj==""){
		alert("占用结束时间为空");
		return;
	}
	$.ajax({
		url : action,
		type : "post",
		dataType : "html",
		success : function(msg) {
			if(msg=="success"){
				alert('操作成功!');
				//window.parent.window.close();		
			}else if(msg=="idnotExist"){
				alert('请先保存!');
				//window.parent.window.close();		
			}else if(msg=="notcard"){
				alert('请填写证书编号!');
				//window.parent.window.close();		
			}else{
				alert('操作失败！');
			}
			
		},
		error:function() {
			alert("添加失败！请刷新重试！");
		}
	});
}
</script>
</head>

<body>
 
<form action="dllszy!saveSimpleData.action" id="Simpleform" name="Simpleform" method="post">
  <!---------------- 隐藏域区域 开始 ----------------->
  <input class="text" type="hidden" id="id" name="id" value="${id}" />
    <input class="text" type="hidden" id="taskInstDbid" name="taskInstDbid" value="${taskInstDbid}" />
      <input type="hidden" name="qyid" id="qyid" value="${qyid}" />
   <input type="hidden" id="username"/>
    <input type="hidden" id="templateCode" name="templateCode" value="${template.templateCode}" />
  <!---------------- 隐藏域区域 结束 ----------------->
  
<div id="tpanel"></div>

<div style="display:none">
<div id="tpanel01" align="center">
<%@ include file="dlzysimpleinput-sqb.jsp" %>
</div>
<div id="tpanel02" align="center">
<%@ include file="dlzysimpleinput-cpb.jsp" %>
</div>
<div id="tpanel03" align="center">
<%@ include file="dlzysimpleinput-gs.jsp" %>
</div>
</div>
</form>
</body>
</html>
